"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["packages_copilot-chat_hooks_use-chat-message-behavior_ts-packages_copilot-chat_hooks_use-grou-d552cd"],{11633:(e,t,n)=>{n.d(t,{WA:()=>ey});var i,r,a,s,o,l,c,u,d,m,g,h,p=n(74848),f=n(21728),y=n(41738),b=n(38621),x=n(81960),_=n(87448);n(51213),n(35247);var N=n(79064),C=n(57352),T=n(69726),v=n(21373),I=n(5524),k=n(69497),$=n(10436),S=n(34164),j=n(96540),w=n(25641),M=n(2635);let A={functionCallButton:"FunctionCallButton-module__functionCallButton--_WmIK"},L={functionReferenceListContainer:"FunctionLoadingUtils-module__functionReferenceListContainer--_vK99",functionLoading:"FunctionLoadingUtils-module__functionLoading--APVUB",spinner:"FunctionLoadingUtils-module__spinner--LI0rU",functionReferenceButton:"FunctionLoadingUtils-module__functionReferenceButton--AiuYU",functionReferenceButtonContents:"FunctionLoadingUtils-module__functionReferenceButtonContents--fRReb",functionReferenceTitle:"FunctionLoadingUtils-module__functionReferenceTitle--pFYb2",functionReferenceListFooter:"FunctionLoadingUtils-module__functionReferenceListFooter--Nvw6l",errorContainer:"FunctionLoadingUtils-module__errorContainer--uwToA",errorHeading:"FunctionLoadingUtils-module__errorHeading--AXPQe",errorMessage:"FunctionLoadingUtils-module__errorMessage--GB_0R",toolDescriptionText:"FunctionLoadingUtils-module__toolDescriptionText--wLOuU",toolNameHighlight:"FunctionLoadingUtils-module__toolNameHighlight--Jpfyk",functionTitleContainer:"FunctionLoadingUtils-module__functionTitleContainer--jes_G"};function R(e){let t=e.references?.[0];return(t?.results??[]).map(e=>({title:e.title,url:e.url,leadingIcon:"bing_search"===e.reference_type?y._:b.GlobeIcon}))}function B(e){return(e.references??[]).map(F)}function F(e){return"file-v2"===e.type?{description:`${e.repoName}/${e.path}`,leadingIcon:b.FileIcon,reference:e,title:(0,w.Xo)(e),url:e.url}:void 0}let D=(e,t)=>t?`${e} on ref ${t}`:e;function U(e){return(e.references??[]).map(P)}function P(e){return"alert.api"===e.type?{description:"Alert",leadingIcon:G,title:"Alert"}:void 0}function G(){return(0,p.jsx)(b.ShieldIcon,{})}function E(e){return(e.references??[]).map(H)}function H(e){return"discussion"===e.type?{title:e.title??"Discussion",description:`Using discussion #${e.number} for ${e.repository.owner}/${e.repository.name}`,url:e.url,leadingIcon:b.CommentDiscussionIcon}:void 0}function q(e){let t,n,i=(0,f.c)(3),{children:r}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,p.jsx)("span",{className:L.spinner,children:(0,p.jsx)(T.A,{size:"small"})}),i[0]=t):t=i[0],i[1]!==r?(n=(0,p.jsxs)("div",{className:L.functionLoading,children:[t,(0,p.jsx)("span",{children:r})]}),i[1]=r,i[2]=n):n=i[2],n}function O(e){return(e.references??[]).filter(V).map(z)}function z(e){return{description:`${e.id} \xb7 ${e.repoOwner}/${e.repoName}`,leadingIcon:b.PlayIcon,title:"Job"}}function V(e){return"job"===e.type}function W(e){return e.jobId?`job ${e.jobId}`:e.runId?`workflow run ${e.runId}`:e.pullRequestNumber?`pull request ${e.pullRequestNumber}`:e.workflowPath?`workflow ${e.workflowPath}`:"unknown job"}function J(e){let t,n,i=(0,f.c)(27),{additionalFooterContent:r,chatManager:a,errorButtonText:s,errorTitle:o,functionCall:l,inProgressMessage:c,noResultsMessage:u,resultsMapper:d,successButtonText:m,toolLink:g,toolName:h,useSelectReference:y}=e,[x,_]=(0,j.useState)(!1),N=(0,j.useId)();if(i[0]!==r||i[1]!==a||i[2]!==N||i[3]!==s||i[4]!==o||i[5]!==x||i[6]!==l||i[7]!==c||i[8]!==u||i[9]!==d||i[10]!==m||i[11]!==g||i[12]!==h||i[13]!==y){n=Symbol.for("react.early_return_sentinel");e:{let e,f,C,T,j=d(l),{status:w,errorMessage:M}=l;if(l.references?.length===1){let e=l.references[0];if(e)switch(e.type){case"text":w="error",M=e.text;break;case"unsupported":w="unsupported",M=e.text}}if("started"===w){let e;i[16]!==c?(e=(0,p.jsx)(q,{children:c}),i[16]=c,i[17]=e):e=i[17],n=e;break e}i[18]===Symbol.for("react.memo_cache_sentinel")?(e=(0,S.$)(L.functionReferenceButton,A.functionCallButton),i[18]=e):e=i[18];let R=x?b.ChevronUpIcon:b.ChevronDownIcon;i[19]===Symbol.for("react.memo_cache_sentinel")?(f=()=>_(K),i[19]=f):f=i[19];let B="error"===w?s:"unsupported"===w?u:m;i[20]!==B?(C=(0,p.jsx)("span",{className:L.functionReferenceButtonContents,children:B}),i[20]=B,i[21]=C):C=i[21],i[22]!==N||i[23]!==x||i[24]!==R||i[25]!==C?(T=(0,p.jsx)(v.Q,{"aria-expanded":x,"aria-controls":N,className:e,leadingVisual:R,onClick:f,variant:"invisible",children:C}),i[22]=N,i[23]=x,i[24]=R,i[25]=C,i[26]=T):T=i[26],t=(0,p.jsxs)(p.Fragment,{children:[T,x&&(0,p.jsxs)("div",{id:N,className:L.functionReferenceListContainer,children:[(0,p.jsx)(I.l,{children:"error"===w?(0,p.jsxs)(I.l.Item,{children:[o,(0,p.jsx)(I.l.Description,{variant:"block",children:M})]}):"unsupported"===w?(0,p.jsxs)(I.l.Item,{children:[M,(0,p.jsx)(I.l.Description,{truncate:!0,children:""})]}):0===j.length?(0,p.jsxs)(I.l.Item,{children:[u,(0,p.jsx)(I.l.Description,{truncate:!0,children:"Try modifying your query by reframing your question."})]}):j.map((e,t)=>e&&(0,p.jsxs)(I.l.LinkItem,{className:"width-fit",href:e.url,onClick:t=>{y&&e.reference&&(a.selectReference(e.reference),t.preventDefault())},target:"_blank",rel:"noopener",children:[e.leadingIcon&&(0,p.jsx)(I.l.LeadingVisual,{children:(0,p.jsx)($.m4,{icon:e.leadingIcon,sx:{...e.leadingIconColor&&{color:e.leadingIconColor}}})}),(0,p.jsx)(k.A,{className:L.functionReferenceTitle,title:e.title,children:e.title}),(0,p.jsx)(I.l.Description,{variant:"block",children:e.description})]},t))}),(0,p.jsxs)("span",{className:L.functionReferenceListFooter,children:["Copilot used the"," ",(0,p.jsx)("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:h})," ","tool",r&&(0,p.jsxs)(p.Fragment,{children:[". ",r]})]})]})]})}i[0]=r,i[1]=a,i[2]=N,i[3]=s,i[4]=o,i[5]=x,i[6]=l,i[7]=c,i[8]=u,i[9]=d,i[10]=m,i[11]=g,i[12]=h,i[13]=y,i[14]=t,i[15]=n}else t=i[14],n=i[15];return n!==Symbol.for("react.early_return_sentinel")?n:t}function K(e){return!e}function Q(e){return"text"!==e.type}function Y(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Z(e){let t=e.references?.[0];return[{title:t?.title||"",url:t?.url||"",description:""}]}let X="https://docs.github.com/en/support/contacting-github-support/using-copilot-in-github-support";function ee(e){return(e.references?.[0]?.results??[]).map(et)}function et(e){return{title:e.title,url:e.url,description:e.url}}function en(e){return(e.references??[]).map(e=>"file"===e.type||"snippet"===e.type?{description:(0,w.Z8)(e),leadingIcon:b.CodeIcon,reference:e,title:(0,w.z$)(e),url:e.url}:void 0)}try{(i=function(e){let t,n,i=(0,f.c)(8),{chatManager:r,functionCall:a,skillArgs:s}=e,o=s.query;i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,p.jsx)(C.A,{href:"https://privacy.microsoft.com/privacystatement",rel:"nofollow",target:"_blank",children:"Microsoft Privacy Statement"}),i[0]=t):t=i[0];let l=`An error occurred when searching for \u{201C}${o}\u{201D}`,c=`Searching the web for \u{201C}${o}\u{201D}`,u=`No web search results for \u{201C}${o}\u{201D} were found`,d=`Using web search results for \u{201C}${o}\u{201D}`;return i[1]!==r||i[2]!==a||i[3]!==l||i[4]!==c||i[5]!==u||i[6]!==d?(n=(0,p.jsx)(J,{additionalFooterContent:t,chatManager:r,errorButtonText:l,errorTitle:"An error occurred when searching the web",toolLink:"https://gh.io/azure-ai-agent-with-bing-grounding",toolName:"Bing Search",functionCall:a,inProgressMessage:c,noResultsMessage:u,resultsMapper:R,successButtonText:d,useSelectReference:!1}),i[1]=r,i[2]=a,i[3]=l,i[4]=c,i[5]=u,i[6]=d,i[7]=n):n=i[7],n}).displayName||(i.displayName="BingGroundingFunctionButton")}catch{}try{(r=function(e){let t,n,i=(0,f.c)(13),{chatManager:r,functionCall:a,skillArgs:s,useSelectReference:o}=e,l=s.query,c="scopingQuery"in s?s.scopingQuery:s.repoOwner&&s.repoName?`repo:${s.repoOwner}/${s.repoName}`:void 0;if(c){var u;let e;i[0]!==c?(e=(u=c).startsWith("repo:")?u.substring(5):u,i[0]=c,i[1]=e):e=i[1],c=e}let d="semantic-code-search"===s.kind?"semantic":"lexical",m=`An error occurred when searching for \u{201C}${l}\u{201D}`;i[2]!==d?(t=d.charAt(0).toUpperCase(),i[2]=d,i[3]=t):t=i[3];let g=`${t+d.slice(1)} search`,h=`Searching for \u{201C}${l}\u{201D}${c&&` in ${c}`}`,y=`No results were found when ${d} searching for \u{201C}${l}\u{201D}${c&&` in ${c}`}`,b=`Using ${d} search results for \u{201C}${l}\u{201D}${c&&` in ${c}`}`;return i[4]!==r||i[5]!==a||i[6]!==m||i[7]!==g||i[8]!==h||i[9]!==y||i[10]!==b||i[11]!==o?(n=(0,p.jsx)(J,{chatManager:r,errorButtonText:m,errorTitle:"An error occurred when searching code",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:g,functionCall:a,inProgressMessage:h,noResultsMessage:y,resultsMapper:en,successButtonText:b,useSelectReference:o}),i[4]=r,i[5]=a,i[6]=m,i[7]=g,i[8]=h,i[9]=y,i[10]=b,i[11]=o,i[12]=n):n=i[12],n}).displayName||(r.displayName="CodeSearchButton")}catch{}try{(a=function(e){let t,n,i=(0,f.c)(13),{chatManager:r,functionCall:a,skillArgs:s,useSelectReference:o}=e,l=s.query,c=s.kbID,{knowledgeBases:u}=(0,M.Pk)();if(i[0]!==c||i[1]!==u){let e;i[3]!==c?(e=e=>e.id===c,i[3]=c,i[4]=e):e=i[4],t=u.find(e),i[0]=c,i[1]=u,i[2]=t}else t=i[2];let d=t,m=d?.name??"the knowledge base",g=`An error occurred when searching for \u{201C}${l}\u{201D} in ${m}`,h=`Searching the ${m} knowledge base for \u{201C}${l}\u{201D}`,y=`No results were found when searching the ${m} knowledge base for \u{201C}${l}\u{201D}`,b=`Using search results from the ${m} knowledge base for \u{201C}${l}\u{201D}`;return i[5]!==r||i[6]!==a||i[7]!==g||i[8]!==h||i[9]!==y||i[10]!==b||i[11]!==o?(n=(0,p.jsx)(J,{chatManager:r,errorButtonText:g,errorTitle:"An error occurred when searching the knowledge base",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:"Knowledge base search",functionCall:a,inProgressMessage:h,noResultsMessage:y,resultsMapper:en,successButtonText:b,useSelectReference:o}),i[5]=r,i[6]=a,i[7]=g,i[8]=h,i[9]=y,i[10]=b,i[11]=o,i[12]=n):n=i[12],n}).displayName||(a.displayName="KnowledgeBaseSearchButton")}catch{}try{(s=function(e){let t,n,i,r,a,s=(0,f.c)(20),{chatManager:o,functionCall:l,skillArgs:c,useSelectReference:u}=e,{path:d,repo:m,ref:g}=c,h=`An error occurred when finding \u{201C}${d}\u{201D} in ${m}`;s[0]!==g||s[1]!==h?(t=D(h,g),s[0]=g,s[1]=h,s[2]=t):t=s[2];let y=`File results for \u{201C}${d}\u{201D} in ${m}`;s[3]!==g||s[4]!==y?(n=D(y,g),s[3]=g,s[4]=y,s[5]=n):n=s[5];let b=`No files matching \u{201C}${d}\u{201D} in ${m} were found`;s[6]!==g||s[7]!==b?(i=D(b,g),s[6]=g,s[7]=b,s[8]=i):i=s[8];let x=`Using results for \u{201C}${d}\u{201D} in ${m}`;return s[9]!==g||s[10]!==x?(r=D(x,g),s[9]=g,s[10]=x,s[11]=r):r=s[11],s[12]!==o||s[13]!==l||s[14]!==t||s[15]!==n||s[16]!==i||s[17]!==r||s[18]!==u?(a=(0,p.jsx)(J,{chatManager:o,errorButtonText:t,errorTitle:"An error occurred when finding a file",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:"Get file",functionCall:l,inProgressMessage:n,noResultsMessage:i,resultsMapper:B,successButtonText:r,useSelectReference:u}),s[12]=o,s[13]=l,s[14]=t,s[15]=n,s[16]=i,s[17]=r,s[18]=u,s[19]=a):a=s[19],a}).displayName||(s.displayName="GetFileButton")}catch{}try{(o=function(e){let t,n,i,r,a,s,o=(0,f.c)(23),{chatManager:l,functionCall:c,skillArgs:u,useSelectReference:d}=e,{path:m,repo:g,ref:h}=u,y=`An error occurred when finding file changes for \u{201C}${m}\u{201D} in ${g}`;o[0]!==h||o[1]!==y?(t=D(y,h),o[0]=h,o[1]=y,o[2]=t):t=o[2];let x=`File changes results for \u{201C}${m} in ${g}`;o[3]!==h||o[4]!==x?(n=D(x,h),o[3]=h,o[4]=x,o[5]=n):n=o[5];let _=`No files changes were found for \u{201C}${m}\u{201D} in ${g}`;o[6]!==h||o[7]!==_?(i=D(_,h),o[6]=h,o[7]=_,o[8]=i):i=o[8],o[9]!==m?(r=e=>(e.references??[]).map(e=>"file-changes"===e.type?{description:`${e.repository.name}/${m}`,leadingIcon:b.FileIcon,reference:e,title:(0,w.Xo)(e),url:e.url}:void 0),o[9]=m,o[10]=r):r=o[10];let N=`Using results for \u{201C}${m}\u{201D} in ${g}`;return o[11]!==h||o[12]!==N?(a=D(N,h),o[11]=h,o[12]=N,o[13]=a):a=o[13],o[14]!==l||o[15]!==c||o[16]!==t||o[17]!==n||o[18]!==i||o[19]!==r||o[20]!==a||o[21]!==d?(s=(0,p.jsx)(J,{chatManager:l,errorButtonText:t,errorTitle:"An error occurred when finding the file changes",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:"Get file changes",functionCall:c,inProgressMessage:n,noResultsMessage:i,resultsMapper:r,successButtonText:a,useSelectReference:d}),o[14]=l,o[15]=c,o[16]=t,o[17]=n,o[18]=i,o[19]=r,o[20]=a,o[21]=d,o[22]=s):s=o[22],s}).displayName||(o.displayName="GetFileChangesButton")}catch{}try{(l=function(e){let t,n=(0,f.c)(5),{chatManager:i,functionCall:r,skillArgs:a,useSelectReference:s}=e,o=`An error occurred when fetching alert information for ${a.url}`;return n[0]!==i||n[1]!==r||n[2]!==o||n[3]!==s?(t=(0,p.jsx)(J,{chatManager:i,errorButtonText:o,errorTitle:"An error occurred when fetching alert information",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:"Get alert information",functionCall:r,inProgressMessage:"Fetching alert information",noResultsMessage:"Unable to fetch alert information",resultsMapper:U,successButtonText:"Using alert information",useSelectReference:s}),n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=t):t=n[4],t}).displayName||(l.displayName="GetAlertButton")}catch{}try{(c=function(e){let t,n=(0,f.c)(7),{chatManager:i,functionCall:r,skillArgs:a,useSelectReference:s}=e,o=`Fetching discussion ${a.discussionNumber}`,l=`Unable to fetch discussion ${a.discussionNumber}`,c=`Using discussion #${a.discussionNumber}`;return n[0]!==i||n[1]!==r||n[2]!==o||n[3]!==l||n[4]!==c||n[5]!==s?(t=(0,p.jsx)(J,{chatManager:i,errorButtonText:"An error occurred when fetching discussion",errorTitle:"An error occurred when fetching discussion",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:"Get discussion",functionCall:r,inProgressMessage:o,noResultsMessage:l,resultsMapper:E,successButtonText:c,useSelectReference:s}),n[0]=i,n[1]=r,n[2]=o,n[3]=l,n[4]=c,n[5]=s,n[6]=t):t=n[6],t}).displayName||(c.displayName="GetDiscussionButton")}catch{}try{q.displayName||(q.displayName="FunctionLoading")}catch{}try{(u=function(e){let t=(0,f.c)(1),{functionCall:n}=e,{status:i}=n;if("started"===i){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(q,{children:"Coming up with a plan"}),t[0]=e):e=t[0],e}}).displayName||(u.displayName="PlanButton")}catch{}try{(d=function(e){let t,n,i=(0,f.c)(10),{chatManager:r,functionCall:a,skillArgs:s,useSelectReference:o}=e;i[0]!==s?(t=W(s),i[0]=s,i[1]=t):t=i[1];let l=t,c=`An error occurred when fetching logs for ${l} in ${s.repo}`,u=`Fetching logs for ${l} in ${s.repo}`,d=`Unable to fetch logs for ${l} in ${s.repo}`,m=`Using logs for ${l} in ${s.repo}`;return i[2]!==r||i[3]!==a||i[4]!==c||i[5]!==u||i[6]!==d||i[7]!==m||i[8]!==o?(n=(0,p.jsx)(J,{chatManager:r,errorButtonText:c,errorTitle:"An error occurred when fetching a commit",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:"Get job logs",functionCall:a,inProgressMessage:u,noResultsMessage:d,resultsMapper:O,successButtonText:m,useSelectReference:o}),i[2]=r,i[3]=a,i[4]=c,i[5]=u,i[6]=d,i[7]=m,i[8]=o,i[9]=n):n=i[9],n}).displayName||(d.displayName="GetJobLogsButton")}catch{}try{J.displayName||(J.displayName="ExpandableFunctionButton")}catch{}try{(m=function(e){let t,n,i,r=(0,f.c)(17),{chatManager:a,functionCall:s,skillArgs:o,useSelectReference:l}=e,c="GitHub API",u=s.references?.[0];if(u){let e=u.type;if(e.endsWith(".api"))if(r[0]!==e){let t=e.split(".")[0];t&&(c=`${t.split("-").map(Y).join(" ")} API`),r[0]=e,r[1]=c}else c=r[1];else"api-response"===u.type&&(c=`${u.resourceType} API`)}r[2]!==o.endpoint||r[3]!==o.endpointDescription?(t=o.endpointDescription?{errorButtonText:`An error occurred when using the GitHub API to ${o.endpointDescription}`,inProgressMessage:`Using the GitHub API to ${o.endpointDescription}`,noResultsMessage:`Unable to use the GitHub API to ${o.endpointDescription}`,successButtonText:`Using the GitHub API to ${o.endpointDescription}`}:{errorButtonText:`An error occurred when fetching from ${o.endpoint}`,inProgressMessage:`Fetching endpoint ${o.endpoint}`,noResultsMessage:`Unable to fetch from ${o.endpoint}`,successButtonText:`Using endpoint ${o.endpoint}`},r[2]=o.endpoint,r[3]=o.endpointDescription,r[4]=t):t=r[4];let d=t;return r[5]!==o?(n=e=>e.references?.filter(Q).map(e=>(function(e,t){switch(e.type){case"release.api":return{description:`Release ${e.tag_name} \xb7 ${t.repo}`,leadingIcon:b.TagIcon,title:e.name??"Release",url:e.html_url};case"issue.api":return{description:`#${e.number} \xb7 ${t.repo}`,leadingIcon:b.IssueOpenedIcon,title:e.title??"Issue",url:e.html_url};case"pull-request.api":return{description:`#${e.number} \xb7 ${t.repo}`,leadingIcon:b.GitPullRequestIcon,title:e.title??"Pull request",url:e.html_url};case"repository.api":return{description:e.description||"",title:e.name,leadingIcon:b.RepoIcon,url:e.html_url};case"commit.api":return{description:`${e.sha} \xb7 ${t.repo}`,leadingIcon:b.GitCommitIcon,title:e.commit.message??"Commit",url:e.html_url};case"topic.api":return{description:e.short_description||"",leadingIcon:b.HashIcon,title:e.display_name??e.name};case"api-response":switch(e.resourceType){case"Repository":return{description:e.data.description||"",title:e.data.name,leadingIcon:b.RepoIcon,url:e.data.html_url};case"Issue":return{description:`#${e.data.number} \xb7 ${t.repo}`,leadingIcon:b.IssueOpenedIcon,title:e.data.title??"Issue",url:e.data.html_url};case"Release":return{description:`Release ${e.data.tag_name} \xb7 ${t.repo}`,leadingIcon:b.TagIcon,title:e.data.name??"Release",url:e.data.html_url};case"PullRequest":return{description:`#${e.data.number} \xb7 ${t.repo}`,leadingIcon:b.GitPullRequestIcon,title:e.data.title??"Pull request",url:e.data.html_url};case"Commit":return{description:`${e.data.sha} \xb7 ${t.repo}`,leadingIcon:b.GitCommitIcon,title:e.data.commit.message??"Commit",url:e.data.html_url};case"Topic":return{description:e.data.short_description||"",leadingIcon:b.HashIcon,title:e.data.display_name??e.data.name};default:return{description:"API endpoint returned results successfully",leadingIcon:b.InfoIcon,title:"API results"}}default:return{description:"API endpoint returned results successfully",leadingIcon:b.InfoIcon,title:"API results"}}})(e,o))??[],r[5]=o,r[6]=n):n=r[6],r[7]!==a||r[8]!==s||r[9]!==d.errorButtonText||r[10]!==d.inProgressMessage||r[11]!==d.noResultsMessage||r[12]!==d.successButtonText||r[13]!==n||r[14]!==c||r[15]!==l?(i=(0,p.jsx)(J,{chatManager:a,errorTitle:"An error occurred when fetching data from the GitHub API",toolLink:"https://docs.github.com/en/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#currently-available-skills",toolName:c,functionCall:s,errorButtonText:d.errorButtonText,inProgressMessage:d.inProgressMessage,noResultsMessage:d.noResultsMessage,successButtonText:d.successButtonText,useSelectReference:l,resultsMapper:n}),r[7]=a,r[8]=s,r[9]=d.errorButtonText,r[10]=d.inProgressMessage,r[11]=d.noResultsMessage,r[12]=d.successButtonText,r[13]=n,r[14]=c,r[15]=l,r[16]=i):i=r[16],i}).displayName||(m.displayName="GetGitHubDataButton")}catch{}try{(g=function(e){let t,n=(0,f.c)(7),{chatManager:i,functionCall:r,skillArgs:a}=e,s=`An error occurred when retrieving \u{201C}${a.name}\u{201D}`,o=`Getting Figma file \u{201C}${a.name}\u{201D}`,l=`Unable to retrieve \u{201C}${a.name}\u{201D}`,c=`Using result from \u{201C}${a.name}\u{201D}`;return n[0]!==i||n[1]!==r||n[2]!==s||n[3]!==o||n[4]!==l||n[5]!==c?(t=(0,p.jsx)(J,{chatManager:i,errorButtonText:s,errorTitle:"An error occurred retrieving Figma file",toolLink:"https://figma.com",toolName:"Get Figma",functionCall:r,inProgressMessage:o,noResultsMessage:l,resultsMapper:Z,successButtonText:c,useSelectReference:!1}),n[0]=i,n[1]=r,n[2]=s,n[3]=o,n[4]=l,n[5]=c,n[6]=t):t=n[6],t}).displayName||(g.displayName="FigmaButton")}catch{}try{(h=function(e){let t,n,i=(0,f.c)(8),{chatManager:r,functionCall:a,skillArgs:s}=e,o=s.rawUserQuery;i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,p.jsx)(C.A,{href:X,rel:"nofollow",target:"_blank",children:"Information on using Copilot in GitHub Support"}),i[0]=t):t=i[0];let l=`An error occurred when searching for \u{201C}${o}\u{201D}`,c=`Searching support documents for \u{201C}${o}\u{201D}`,u=`No support documents for \u{201C}${o}\u{201D} were found`,d=`Using support search results for \u{201C}${o}\u{201D}`;return i[1]!==r||i[2]!==a||i[3]!==l||i[4]!==c||i[5]!==u||i[6]!==d?(n=(0,p.jsx)(J,{additionalFooterContent:t,chatManager:r,errorButtonText:l,errorTitle:"An error occurred when searching support documents",toolLink:X,toolName:"Support Search",functionCall:a,inProgressMessage:c,noResultsMessage:u,resultsMapper:ee,successButtonText:d,useSelectReference:!1}),i[1]=r,i[2]=a,i[3]=l,i[4]=c,i[5]=u,i[6]=d,i[7]=n):n=i[7],n}).displayName||(h.displayName="SupportSearchButton")}catch{}let ei=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.SearchIcon,{}),t[0]=e):e=t[0],e},er=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.FileIcon,{}),t[0]=e):e=t[0],e},ea=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.TagIcon,{}),t[0]=e):e=t[0],e},es=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.PlayIcon,{}),t[0]=e):e=t[0],e},eo=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.BookIcon,{}),t[0]=e):e=t[0],e},el=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.CommentDiscussionIcon,{}),t[0]=e):e=t[0],e},ec=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.TasklistIcon,{}),t[0]=e):e=t[0],e},eu=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(eu,{}),t[0]=e):e=t[0],e},ed=()=>{let e,t=(0,f.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(b.AgentIcon,{}),t[0]=e):e=t[0],e},em="planning response";function eg(e){let t,n,i,r,a=(0,f.c)(10),{maxWidth:s,functionMetadata:o}=e;return a[0]!==o?(t=o.icon(),a[0]=o,a[1]=t):t=a[1],a[2]!==s?(n={maxWidth:s},a[2]=s,a[3]=n):n=a[3],a[4]!==o.completedText||a[5]!==n?(i=(0,p.jsx)(_.PA,{title:o.completedText,sx:n,children:o.completedText}),a[4]=o.completedText,a[5]=n,a[6]=i):i=a[6],a[7]!==t||a[8]!==i?(r=(0,p.jsxs)(p.Fragment,{children:[t,i]}),a[7]=t,a[8]=i,a[9]=r):r=a[9],r}function eh(e){let t,n,i,r,a=(0,f.c)(10),{maxWidth:s,functionMetadata:o}=e;return a[0]!==o?(t=o.icon(),a[0]=o,a[1]=t):t=a[1],a[2]!==s?(n={maxWidth:s},a[2]=s,a[3]=n):n=a[3],a[4]!==o.loadingText||a[5]!==n?(i=(0,p.jsx)(_.PA,{title:o.loadingText,sx:n,children:o.loadingText}),a[4]=o.loadingText,a[5]=n,a[6]=i):i=a[6],a[7]!==t||a[8]!==i?(r=(0,p.jsxs)(p.Fragment,{children:[t,i]}),a[7]=t,a[8]=i,a[9]=r):r=a[9],r}function ep(e){let t,n,i,r,a=(0,f.c)(10),{functionCall:s,functionMetadata:o}=e;return a[0]!==o.activeSkillText?(t=(0,p.jsxs)(x.A,{as:"h3",className:L.errorHeading,children:["An error occurred while ",o.activeSkillText]}),a[0]=o.activeSkillText,a[1]=t):t=a[1],a[2]!==s.errorMessage?(n=(0,p.jsx)("p",{className:L.errorMessage,children:s.errorMessage}),a[2]=s.errorMessage,a[3]=n):n=a[3],a[4]!==o.name?(i=(0,p.jsxs)("p",{className:L.toolDescriptionText,children:["Copilot used the ",(0,p.jsx)("span",{className:L.toolNameHighlight,children:o.name})," tool"]}),a[4]=o.name,a[5]=i):i=a[5],a[6]!==t||a[7]!==n||a[8]!==i?(r=(0,p.jsxs)("div",{className:L.errorContainer,children:[t,n,i]}),a[6]=t,a[7]=n,a[8]=i,a[9]=r):r=a[9],r}function ef(e){let t,n=(0,f.c)(4),{functionCall:i,functionMetadata:r,panelWidth:a}=e,s=a?a-130:N.Jt.DEFAULT_PANEL_WIDTH;if(n[0]!==i||n[1]!==r||n[2]!==s){let e=i?.status==="error"?(0,p.jsx)(ep,{functionCall:i,functionMetadata:r}):i?.status==="completed"?(0,p.jsx)(eg,{maxWidth:s,functionMetadata:r}):(0,p.jsx)(eh,{maxWidth:s,functionMetadata:r});t=(0,p.jsx)("div",{className:L.functionTitleContainer,children:e}),n[0]=i,n[1]=r,n[2]=s,n[3]=t}else t=n[3];return t}function ey(e){if(!e)return em;let t=function(e){if(e)return(e=>{switch(e.kind){case"bing-search":return{id:"bing-search",referenceType:"web-search",loadingText:`Using Bing to search for "${e.query}"`,completedText:`Bing results for "${e.query}"`,icon:y._,name:"Bing search",activeSkillText:"searching Bing"};case"lexical-code-search":return{id:"codesearch",loadingText:`Search for "${e.query}" in "${e.scopingQuery}"`,completedText:`Search results for "${e.query}" in "${e.scopingQuery}"`,icon:ei,name:"Code search",activeSkillText:"searching the codebase"};case"semantic-code-search":return{id:"codesearch",loadingText:`Search for "${e.query}" in "${e.repoOwner}/${e.repoName}"`,completedText:`Search results for "${e.query}" in "${e.repoOwner}/${e.repoName}"`,icon:ei,name:"Code search",activeSkillText:"searching the codebase"};case"kb-search":return{id:"kb-search",loadingText:`Searching for "${e.query}" in the knowledge base`,completedText:`Knowledge base search results for "${e.query}"`,icon:eo,name:"Knowledge base search",activeSkillText:"searching the knowledge base"};case"getalert":return{id:"getalert",loadingText:"Retrieving information about alerts",completedText:"Including information about alerts",icon:()=>(0,p.jsx)(b.ShieldIcon,{}),name:"Get alert",activeSkillText:"getting alert"};case"get-github-data":return{id:"get-github-data",loadingText:`Fetching ${e.endpoint}`,completedText:`Results of ${e.endpoint}`,icon:ea,name:"Get GitHub Data",activeSkillText:"getting data"};case"get-actions-job-logs":{let t=W(e),n=t.charAt(0).toUpperCase()+t.slice(1);return{id:"get-actions-jog-logs",loadingText:`Retrieving ${t} in ${e.repo}`,completedText:`${n} in ${e.repo}`,icon:es,name:"Get job logs",activeSkillText:"getting job logs"}}case"getdiscussion":return{id:"getdiscussion",loadingText:`Fetching discussion ${e.discussionNumber}`,completedText:`Details about discussion #${e.discussionNumber}`,icon:el,name:"Get discussion",activeSkillText:"getting discussion"};case"getfile":return{id:"getfile",loadingText:"Searching for file",completedText:"Using results of get file",icon:er,name:"Get file",activeSkillText:"searching for file"};case"getfilechanges":return{id:"getfilechanges",loadingText:"Searching for file changes",completedText:`File changes for ${e.path} in ${e.repo}`,icon:er,name:"Get file changes",activeSkillText:"searching for file changes"};case"planskill":return{id:"planskill",loadingText:"Planning response...",completedText:"Plan created",icon:ec,name:"Plan skill",activeSkillText:"planning response"};case"support-search":return{id:"supportsearch",loadingText:"Searching for support documents",completedText:"Using results of support search",icon:eo,name:"Support search",activeSkillText:"searching for support documents"};case"get-figma":return{id:"getfigma",loadingText:"Analyzing Figma file",completedText:"Using results of Figma file",icon:eo,name:"Get Figma",activeSkillText:"analyzing Figma file"};case"codesearchagentskill":return{id:"codesearchagentskill",loadingText:"Using the code search agent",completedText:"Using results of code search agent",icon:eo,name:"Code Search Agent",activeSkillText:"searching the codebase"};case"github-draft-issue.draft-issue":{let t,n;return e.issueNumber?(t=e.repository?`Drafting update for @${e.repository}/issues/${e.issueNumber}`:"Drafting update",n=e.repository?`Drafted update for @${e.repository}/issues/${e.issueNumber}`:"Drafted update"):(t=e.repository?`Drafting issue in ${e.repository}`:"Drafting issue",n=e.repository?`Drafted issue in ${e.repository}`:"Drafted issue"),{id:"github-draft-issue.draft-issue",loadingText:t,completedText:n,icon:eu,name:"GitHub Draft Issue Step: Draft Issue",activeSkillText:t.toLowerCase()}}case"github-draft-issue.existing-issue":{let t=e.repository?`Drafting issue in ${e.repository}`:"Drafting issue";return{id:"github-draft-issue.existing-issue",loadingText:t,completedText:e.repository?`Drafted issue in ${e.repository}`:"Drafted issue",icon:eu,name:"GitHub Draft Issue Step: Existing Issue",activeSkillText:t.toLowerCase()}}case"github-draft-issue.repository-metadata":{let t=`Fetching metadata from ${e.repository}`;return{id:"github-draft-issue.repository-metadata",loadingText:t,completedText:`Using metadata from ${e.repository}`,icon:eu,name:"GitHub Draft Issue Step: Repository Metadata",activeSkillText:t.toLowerCase()}}case"github-draft-issue.get-issues":{let t=(e.issueRefs||[]).length>1?"Fetching issues":"Fetching issue";return{id:"github-draft-issue.get-issues",loadingText:t,completedText:(e.issueRefs||[]).length>1?"Fetched issues":"Fetched issue",icon:eu,name:"GitHub Draft Issue Step: Get Issues",activeSkillText:t.toLowerCase()}}case"github-coding-agent-":case"github-coding-agent":{let t=`Creating agent task in ${e.repository}`,n=`Created agent task in ${e.repository}`;return{id:e.kind,loadingText:t,completedText:n,icon:ed,name:"Copilot Coding Agent",activeSkillText:t.toLowerCase()}}}})({...JSON.parse(e?.arguments||"{}"),kind:e.slug})}(e);return e.statusMessage??t?.activeSkillText??em}try{ei.displayName||(ei.displayName="CodeSearchIcon")}catch{}try{er.displayName||(er.displayName="GetFileIcon")}catch{}try{ea.displayName||(ea.displayName="ReleaseIcon")}catch{}try{es.displayName||(es.displayName="JobIcon")}catch{}try{eo.displayName||(eo.displayName="KnowledgeBaseIcon")}catch{}try{el.displayName||(el.displayName="DiscussionIcon")}catch{}try{ec.displayName||(ec.displayName="PlanIcon")}catch{}try{eu.displayName||(eu.displayName="IssueDraftIcon")}catch{}try{ed.displayName||(ed.displayName="AgentTaskIcon")}catch{}try{eg.displayName||(eg.displayName="FunctionCompleted")}catch{}try{eh.displayName||(eh.displayName="FunctionLoading")}catch{}try{ep.displayName||(ep.displayName="FunctionError")}catch{}try{ef.displayName||(ef.displayName="FunctionTitle")}catch{}},17285:(e,t,n)=>{n.d(t,{Z:()=>i});function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}},31958:(e,t,n)=>{n.d(t,{h:()=>l});var i=n(74848),r=n(21728),a=n(84078),s=n(34164);let o={interruptedBanner:"InterruptedBanner-module__interruptedBanner--o4zN7",hasContent:"InterruptedBanner-module__hasContent--eZVJ0"};function l(e){let t,n,l=(0,r.c)(4),{messageHasContent:c}=e,u=c&&o.hasContent;return l[0]!==u?(t=(0,s.$)(o.interruptedBanner,u),l[0]=u,l[1]=t):t=l[1],l[2]!==t?(n=(0,i.jsx)(a.l,{className:t,"data-testid":"chat-message-interrupted",description:"Copilot was interrupted before it could finish this message.",hideTitle:!0,title:"Message interrupted",variant:"info"}),l[2]=t,l[3]=n):n=l[3],n}try{l.displayName||(l.displayName="InterruptedBanner")}catch{}},32744:(e,t,n)=>{n.d(t,{m:()=>d});var i=n(74848),r=n(21728),a=n(81960),s=n(21373),o=n(34164),l=n(96540),c=n(2635);let u={ConfirmationContainer:"Confirmation-module__ConfirmationContainer--LWT81",confirmationTitle:"Confirmation-module__confirmationTitle--e5Xlk",confirmationMessage:"Confirmation-module__confirmationMessage--APY8y",actionButtonsContainer:"Confirmation-module__actionButtonsContainer--MdVl0"};function d(e){let t,n,d,g,h,p,f,y=(0,r.c)(22),{confirmation:b,handleConfirmation:x,isLatestMessage:_}=e,N=(0,c.Pk)();if(y[0]!==b.confirmation||y[1]!==N.allClientConfirmations){let e=JSON.stringify(Object.values(b.confirmation).sort());t=N.allClientConfirmations?.includes(e),y[0]=b.confirmation,y[1]=N.allClientConfirmations,y[2]=t}else t=y[2];let C=t,{isWaitingOnCopilot:T,currentUserLogin:v}=N,[I,k]=(0,l.useState)(C&&!_);y[3]!==b.confirmation||y[4]!==b.onSubmit||y[5]!==b.title||y[6]!==v||y[7]!==x?(n=e=>{k(!0),x({state:e,userLogin:v,confirmation:b.confirmation},b.title,b.onSubmit)},y[3]=b.confirmation,y[4]=b.onSubmit,y[5]=b.title,y[6]=v,y[7]=x,y[8]=n):n=y[8];let $=n;return y[9]===Symbol.for("react.memo_cache_sentinel")?(d=(0,o.$)("border rounded-2",u.ConfirmationContainer),y[9]=d):d=y[9],y[10]!==b.title?(g=(0,i.jsx)(a.A,{as:"h3",className:u.confirmationTitle,children:b.title}),y[10]=b.title,y[11]=g):g=y[11],y[12]!==b.message?(h=b.message.split(` `).map(m),y[12]=b.message,y[13]=h):h=y[13],y[14]!==I||y[15]!==$||y[16]!==T?(p=!I&&(0,i.jsxs)("div",{className:u.actionButtonsContainer,children:[(0,i.jsx)(s.Q,{disabled:T,variant:"primary",onClick:()=>$("accepted"),children:"Allow"}),(0,i.jsx)(s.Q,{disabled:T,onClick:()=>$("dismissed"),children:"Dismiss"})]}),y[14]=I,y[15]=$,y[16]=T,y[17]=p):p=y[17],y[18]!==g||y[19]!==h||y[20]!==p?(f=(0,i.jsxs)("div",{className:d,children:[g,h,p]}),y[18]=g,y[19]=h,y[20]=p,y[21]=f):f=y[21],f}function m(e){return(0,i.jsx)("p",{className:u.confirmationMessage,children:e},e)}try{d.displayName||(d.displayName="Confirmation")}catch{}},42983:(e,t,n)=>{n.d(t,{$:()=>l});var i=n(74848),r=n(21728),a=n(38621),s=n(26108),o=n(12970);function l(e){let t,n,l=(0,r.c)(10),{handleRetryMessage:c,disabled:u,showModelPicker:d,model:m,navigateToNewThread:g}=e,h=void 0!==u&&u,p=void 0!==d&&d;l[0]!==c||l[1]!==m?(t=()=>{c(m)},l[0]=c,l[1]=m,l[2]=t):t=l[2];let f=t;if(p&&(!g||!m))throw Error("navigateToNewThread and model must be provided in order to show the model picker");return l[3]!==h||l[4]!==f||l[5]!==c||l[6]!==m||l[7]!==g||l[8]!==p?(n=p?(0,i.jsx)(o.Yb,{onNewThreadSelected:g,type:"message-retry",selectedModel:m,onModelSelected:c,disabled:h}):(0,i.jsx)(s.K,{variant:"invisible","aria-label":"Retry","data-testid":"retry-button",onClick:f,icon:a.SyncIcon,disabled:h}),l[3]=h,l[4]=f,l[5]=c,l[6]=m,l[7]=g,l[8]=p,l[9]=n):n=l[9],n}try{l.displayName||(l.displayName="RetryButton")}catch{}},52940:(e,t,n)=>{n.d(t,{p:()=>h});var i=n(4559),r=n(53419),a=n(96540),s=n(46665),o=n(25641),l=n(2635),c=n(33592),u=n(72303),d=n(72206),m=n(17285),g=n(27359);function h({excludeFeedback:e,inputRef:t,isLatestMessage:n,isStreaming:h,removeOutdatedContentPreviewItems:p}){let{message:f}=(0,s.V)(),y=(0,l.bP)("currentUserLogin","mode"),b=(0,d.tD)(),x=(0,c.b)(),_=(0,g.v)(),N=(0,o.Th)(f,y.currentUserLogin),C="Copilot"===N.name,T="user"===N.type,v=C||(0,o.yh)(N),I=C&&!!f.agentErrors?.length,k=!I&&!!C&&!!f.error&&f.error.isError,$=C&&!e&&(!n||!h)&&!k,S=(0,a.useRef)(null),j=f.interrupted,w=f.clientConfirmations&&f.clientConfirmations.length>0,M=k&&f.error?.retryable,[A,L]=(0,a.useState)([]),[R,B]=(0,a.useState)(void 0),F=(M||j)&&n,D=n&&h,U=(0,a.useMemo)(()=>({openLinksInCurrentTab:"assistive"===y.mode,isStreaming:D,extensions:_?.markdownExtensions?_.markdownExtensions.map(e=>e()):[]}),[y.mode,D,_?.markdownExtensions]),P=!k&&($||v&&!!f.content&&!h)&&(!T||!f.confirmations)||T&&!n||k&&n,G=(0,a.useRef)(0);(0,a.useEffect)(()=>{B(void 0),L([])},[f.id]),(0,a.useEffect)(()=>{let e=(f.skillExecutions??[]).find(e=>!A.some(t=>t.slug===e.slug&&t.statusMessage===e.statusMessage));if(e){let t=setTimeout(()=>{G.current=Date.now(),L([...A,e]),B(e)},Math.max(0,2e3-(Date.now()-G.current)));return()=>clearTimeout(t)}},[f.skillExecutions,A]),(0,a.useEffect)(()=>{D&&(0,i.i)("Copilot is responding")},[D]),(0,a.useEffect)(()=>{n&&!h&&S.current&&(0,i.C)(S.current)},[n,h]);let E=(0,a.useCallback)(async(e,t,n)=>{if(n)n("accepted"===e.state);else{let n=b();await x.sendChatMessage({thread:(0,u.W)(n),content:`@${N.name} ${(0,m.Z)(e.state)} Confirmation: ${t}`,references:f.references??[],topic:n.currentTopic,context:n.context,confirmations:e,customInstructions:n.customInstructions,model:n.model})}},[b,x,N.name,f.references]),H=(0,a.useCallback)(()=>{window.setTimeout(()=>t?.current?.focus(),1)},[t]),q=(0,a.useCallback)(async()=>{let e=b(),t=(0,u.W)(e);t&&(p?.(),H(),(0,r.BI)("dotcom_chat.activate",{target:"RESPONSE_ACTION_RETRY",mode:e.mode}),await x.retryLastUnsuccessfulChatMessage(t))},[b,p,H,x]),O=(0,a.useCallback)(async e=>{let t=b(),n=(0,u.W)(t);n&&(p?.(),H(),(0,r.BI)("dotcom_chat.activate",{target:"RESPONSE_ACTION_RETRY_FOR_NEW_SUBTHREAD",mode:t.mode}),await x.retryUserChatMessage(n,f,e))},[b,x,f,p,H]),z=(0,a.useCallback)(async e=>{let t=b(),n=(0,u.W)(t);n&&(p?.(),await x.editUserChatMessage(n,f,e))},[b,x,f,p]);return{author:N,removeOutdatedContentPreviewItems:p,handleConfirmationAction:E,handleRetryErrorMessage:q,handleRetryCopilotResponse:O,handleEditUserMessage:z,hasClientConfirmations:w,isCopilot:C,isUser:T,isAI:v,isAgentError:I,isError:k,isInterrupted:j,myRef:S,rendererConfig:U,renderFeedback:$,shouldShowMessageActions:P,skillExecutionToUseForRespondingText:R,showRetryButton:F}}},55009:(e,t,n)=>{n.d(t,{o:()=>u});var i=n(74848),r=n(21728),a=n(34164),s=n(96540);let o={chatImageAttachment:"ChatImage-module__chatImageAttachment--yonSm",squareView:"ChatImage-module__squareView--nZPWG",fullView:"ChatImage-module__fullView--hHWSy",userAttachedImage:"ChatImage-module__userAttachedImage--e5PZR",overlay:"ChatImage-module__overlay--Z0bfs",overlayScreen:"ChatImage-module__overlayScreen--oZnB_",expandIcon:"ChatImage-module__expandIcon--H2k4g"};function l(e){let t,n,a=(0,r.c)(5),{className:s,size:o}=e,l=o||14,c=o||14;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.672 5.342a.8.8 0 0 0 .05-.295V.805a.75.75 0 0 0-.75-.75H8.73a.75.75 0 0 0 0 1.5h2.433L8.138 4.577A.75.75 0 0 0 9.2 5.638l3.024-3.023v2.432a.75.75 0 0 0 1.45.295M.328 8.657a.8.8 0 0 0-.05.295v4.243a.75.75 0 0 0 .75.75h4.243a.75.75 0 0 0 0-1.5H2.838l3.024-3.023A.75.75 0 1 0 4.8 8.362l-3.024 3.023V8.952a.75.75 0 0 0-1.45-.295",clipRule:"evenodd"}),a[0]=t):t=a[0],a[1]!==s||a[2]!==l||a[3]!==c?(n=(0,i.jsx)("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:l,height:c,fill:"none",viewBox:"0 0 14 14",role:"presentation",children:t}),a[1]=s,a[2]=l,a[3]=c,a[4]=n):n=a[4],n}try{l.displayName||(l.displayName="ExpandIcon")}catch{}let c=e=>{let t,n,c,u,d,m,g,h,p,f=(0,r.c)(25),{src:y,alt:b,onClick:x,useOverlay:_,mode:N,squareView:C}=e,[T,v]=(0,s.useState)(!1),I=C?o.squareView:o.fullView,k="assistive"===N;f[0]!==I||f[1]!==k?(t=(0,a.$)(o.chatImageAttachment,I,{assistive:k}),f[0]=I,f[1]=k,f[2]=t):t=f[2];let $=C?o.squareView:o.fullView;return f[3]!==$?(n=(0,a.$)(o.userAttachedImage,$),f[3]=$,f[4]=n):n=f[4],f[5]!==b||f[6]!==y||f[7]!==n?(c=(0,i.jsx)("img",{className:n,src:y,alt:b}),f[5]=b,f[6]=y,f[7]=n,f[8]=c):c=f[8],f[9]!==T||f[10]!==C?(u=(0,a.$)(o.overlay,{hovered:T,[o.squareView]:C}),f[9]=T,f[10]=C,f[11]=u):u=f[11],f[12]===Symbol.for("react.memo_cache_sentinel")?(d=()=>v(!0),m=()=>v(!1),f[12]=d,f[13]=m):(d=f[12],m=f[13]),f[14]!==_?(g=_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:o.overlayScreen}),(0,i.jsx)(l,{className:o.expandIcon,size:20})]}),f[14]=_,f[15]=g):g=f[15],f[16]!==x||f[17]!==y||f[18]!==g||f[19]!==u?(h=(0,i.jsx)("a",{href:y,className:u,onClick:x,onMouseEnter:d,onMouseLeave:m,"aria-label":"Open image thumbnail",target:"_blank",rel:"noreferrer",children:g}),f[16]=x,f[17]=y,f[18]=g,f[19]=u,f[20]=h):h=f[20],f[21]!==h||f[22]!==t||f[23]!==c?(p=(0,i.jsxs)("div",{className:t,children:[c,h]}),f[21]=h,f[22]=t,f[23]=c,f[24]=p):p=f[24],p},u=(0,s.memo)(c);try{c.displayName||(c.displayName="ChatImageUnmemoized")}catch{}try{u.displayName||(u.displayName="ChatImage")}catch{}},59524:(e,t,n)=>{n.d(t,{Q:()=>c});var i=n(74848),r=n(21728),a=n(38621),s=n(4908),o=n(23398);let l={Details:"ChatMessageMcpToolResultsList-module__Details--ri1It",ToolInputOutputHeading:"ChatMessageMcpToolResultsList-module__ToolInputOutputHeading--tgNpb",ToolInputOutputContents:"ChatMessageMcpToolResultsList-module__ToolInputOutputContents--DB0rS"};function c(e){let t,n,a=(0,r.c)(4),{mcpToolResults:s}=e;return s&&0!==s.length?(a[0]!==s?(t=s.map(u),a[0]=s,a[1]=t):t=a[1],a[2]!==t?(n=(0,i.jsx)("div",{className:"mb-2",children:t}),a[2]=t,a[3]=n):n=a[3],n):null}function u(e){return(0,i.jsx)(d,{result:e},e.toolName)}function d(e){let t,n,c,u,d,m,g,h,p,f,y,b,x,_=(0,r.c)(29),{result:N}=e;_[0]===Symbol.for("react.memo_cache_sentinel")?(t={},_[0]=t):t=_[0];let{getDetailsProps:C,open:T}=(0,s.A)(t),v=N.toolName;return _[1]!==C?(n=C(),_[1]=C,_[2]=n):n=_[2],_[3]!==T?(c=!T&&(0,i.jsx)(a.ChevronRightIcon,{size:16,className:"mr-1 inline-block"}),_[3]=T,_[4]=c):c=_[4],_[5]!==T?(u=T&&(0,i.jsx)(a.ChevronDownIcon,{size:16,className:"mr-1 inline-block"}),_[5]=T,_[6]=u):u=_[6],_[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,i.jsx)(a.ToolsIcon,{size:16,className:"mr-1 inline-block"}),_[7]=d):d=_[7],_[8]!==N.serverName||_[9]!==N.toolName||_[10]!==c||_[11]!==u?(m=(0,i.jsxs)("summary",{children:[c,u,d,"Called ",N.toolName," from ",N.serverName]}),_[8]=N.serverName,_[9]=N.toolName,_[10]=c,_[11]=u,_[12]=m):m=_[12],_[13]===Symbol.for("react.memo_cache_sentinel")?(g=(0,i.jsx)("h3",{className:l.ToolInputOutputHeading,children:"Input"}),_[13]=g):g=_[13],_[14]!==N.toolArguments?(h=JSON.stringify(N.toolArguments,null,2),_[14]=N.toolArguments,_[15]=h):h=_[15],_[16]!==h?(p=(0,i.jsx)("div",{className:"border rounded p-2 mb-2",children:(0,i.jsx)("span",{className:l.ToolInputOutputContents,children:h})}),_[16]=h,_[17]=p):p=_[17],_[18]===Symbol.for("react.memo_cache_sentinel")?(f=(0,i.jsx)("h3",{className:l.ToolInputOutputHeading,children:"Output"}),_[18]=f):f=_[18],_[19]!==N.toolResponse?(y=JSON.stringify(N.toolResponse,null,2),_[19]=N.toolResponse,_[20]=y):y=_[20],_[21]!==y?(b=(0,i.jsx)("div",{className:"border rounded p-2 mb-2",children:(0,i.jsx)("span",{className:l.ToolInputOutputContents,children:y})}),_[21]=y,_[22]=b):b=_[22],_[23]!==N.toolName||_[24]!==p||_[25]!==b||_[26]!==n||_[27]!==m?(x=(0,i.jsxs)(o.A,{className:l.Details,...n,children:[m,g,p,f,b]},v),_[23]=N.toolName,_[24]=p,_[25]=b,_[26]=n,_[27]=m,_[28]=x):x=_[28],x}try{c.displayName||(c.displayName="ChatMessageMcpToolResultsList")}catch{}try{d.displayName||(d.displayName="McpToolResult")}catch{}},63262:(e,t,n)=>{n.d(t,{A:()=>u,i:()=>c});var i=n(74848),r=n(21728),a=n(71315),s=n(96540),o=n(2635),l=n(7104);let c=e=>{let t,n,c,u,d=(0,r.c)(10),{isLastGroup:m,children:g}=e,{scrollContainerHeight:h,scrollToBottom:p}=(0,l.b)(),{threadHasNewMessages:f,pendingFirstMessage:y}=(0,o.Pk)(),b=m&&(f||y);if(d[0]!==b||d[1]!==p?(t=()=>{b&&p("smooth")},n=[b,p],d[0]=b,d[1]=p,d[2]=t,d[3]=n):(t=d[2],n=d[3]),(0,s.useEffect)(t,n),b)if(a.cg?.CSS?.supports("container-type: size")){let e;d[4]===Symbol.for("react.memo_cache_sentinel")?(e={minHeight:"100cqh"},d[4]=e):e=d[4],u=e}else{let e;d[5]!==h?(e={minHeight:h},d[5]=h,d[6]=e):e=d[6],u=e}return d[7]!==g||d[8]!==u?(c=(0,i.jsx)("div",{style:u,children:g}),d[7]=g,d[8]=u,d[9]=c):c=d[9],c};function u(e){return e.reduce((e,t)=>{let n=e.at(-1);return"assistant"===(n?.at(-1)?.role??"assistant")&&"user"===t.role?e.push([t]):n?.push(t),e},[])}try{c.displayName||(c.displayName="ChatMessagesGroup")}catch{}},73010:(e,t,n)=>{n.d(t,{G:()=>b});var i=n(74848),r=n(21728),a=n(38621),s=n(26108),o=n(96540),l=n(2635),c=n(33592),u=n(46665);let d={submittedFeedbackButton:"Feedback-module__submittedFeedbackButton--BrkHM"};var m=n(77274),g=n(35247),h=n(79064),p=n(54508);let f=[{name:"Bad",value:"NEGATIVE",icon:m.pu,color:"bad"},{name:"Good",value:"POSITIVE",icon:m.ms,color:"good"}],y=(0,o.forwardRef)(function({messageId:e,threadId:t,returnFocusRef:n,onSubmitted:r,onClose:a},s){let l=(0,c.b)(),u=(0,o.useRef)(null),d=(0,o.useRef)(null),y=(0,o.useRef)(void 0);(0,o.useImperativeHandle)(s,()=>({openDialog:e=>{y.current=e,g.W.copilotChatInterviewSurvey?u.current?.openDialog():d.current?.openDialog(e)}}));let b=async(n,i)=>{let a=[];if(null==n&&a.push("Please select a rating."),i.length>500&&a.push("Please keep your feedback within 500 characters or less."),a.length>0)return a;try{(await l.service.sendFeedback({feedback:n,feedbackChoice:[],messageId:e,threadId:t,textResponse:i})).ok?r?.(n):a.push("An error occurred while submitting your feedback.")}catch{a.push("An error occurred while submitting your feedback.")}return a};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.E,{ref:u,title:"Give additional feedback",onClose:e=>{"no-thanks"===e?d.current?.openDialog(y.current):a?.()}}),(0,i.jsx)(m.NE,{title:"Give additional feedback",ref:d,options:f,onSubmit:b,onClose:a,requestID:h.Jt.getRequestID(e),returnFocusRef:n})]})});function b(e){let t,n,m,g,h,p=(0,r.c)(20),{iconSize:f}=e,{message:b}=(0,u.V)(),x=b.id,_=b.threadID,N=(0,c.b)(),C=(0,o.useRef)(null),T=(0,o.useRef)(null);p[0]!==N||p[1]!==b?(t=e=>{N.handleFeedback(b,e)},p[0]=N,p[1]=b,p[2]=t):t=p[2];let v=t,{optedInToUserFeedback:I}=(0,l.Pk)();p[3]!==N.service||p[4]!==x||p[5]!==v||p[6]!==I||p[7]!==_?(n=e=>{N.service.sendFeedback({feedback:e,messageId:x,threadId:_}),v(e),I?C.current?.openDialog(e):T.current?.focus()},p[3]=N.service,p[4]=x,p[5]=v,p[6]=I,p[7]=_,p[8]=n):n=p[8];let k=n;return p[9]!==f||p[10]!==b.feedback||p[11]!==k?(m=null!=b.feedback?(0,i.jsx)(s.K,{ref:T,"aria-label":`${b.feedback.toLocaleLowerCase()} feedback submitted`,icon:"POSITIVE"===b.feedback?a.ThumbsupIcon:a.ThumbsdownIcon,variant:"invisible",size:f,"aria-disabled":!0,className:d.submittedFeedbackButton}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.K,{icon:a.ThumbsupIcon,"aria-label":"Good response",onClick:()=>k("POSITIVE"),variant:"invisible",size:f}),(0,i.jsx)(s.K,{icon:a.ThumbsdownIcon,size:f,"aria-label":"Bad response",onClick:()=>k("NEGATIVE"),variant:"invisible"})]}),p[9]=f,p[10]=b.feedback,p[11]=k,p[12]=m):m=p[12],p[13]!==x||p[14]!==v||p[15]!==_?(g=(0,i.jsx)(y,{ref:C,messageId:x,threadId:_,onSubmitted:v,returnFocusRef:T}),p[13]=x,p[14]=v,p[15]=_,p[16]=g):g=p[16],p[17]!==m||p[18]!==g?(h=(0,i.jsxs)(i.Fragment,{children:[m,g]}),p[17]=m,p[18]=g,p[19]=h):h=p[19],h}y.displayName="MessageFeedbackDialog";try{b.displayName||(b.displayName="Feedback")}catch{}},77939:(e,t,n)=>{n.d(t,{A:()=>i});let i={messageContainer:"ChatMessage-module__messageContainer--P78Nq","message-action":"ChatMessage-module__message-action--vjrqQ",user:"ChatMessage-module__user--UGo2h",ai:"ChatMessage-module__ai--zMYOs",contentContainer:"ChatMessage-module__contentContainer--XTssz",message:"ChatMessage-module__message--iDqZL",messageContent:"ChatMessage-module__messageContent--x5cFE",hasClientConfirmations:"ChatMessage-module__hasClientConfirmations--UEFyq",agentUnauthorizedAvatar:"ChatMessage-module__agentUnauthorizedAvatar--GTuSs",skillExecutionText:"ChatMessage-module__skillExecutionText--HOEoJ",fileListItem:"ChatMessage-module__fileListItem--hX_vZ",avatar:"ChatMessage-module__avatar--ublrF",clientConfirmationContainer:"ChatMessage-module__clientConfirmationContainer--LgTin",confirmationStatusText:"ChatMessage-module__confirmationStatusText--pUhyM",messageContentWrapper:"ChatMessage-module__messageContentWrapper--L96Ez","snippet-clipboard-content":"ChatMessage-module__snippet-clipboard-content--gS3Lo",messageActionsContainer:"ChatMessage-module__messageActionsContainer--WIjsz"}},82151:(e,t,n)=>{n.d(t,{R:()=>g});var i=n(74848),r=n(21728),a=n(57352),s=n(34164),o=n(7277),l=n(99054),c=n(97949),u=n(16378),d=n(46665),m=n(6224);function g(e){let t,n,a,g,p,f,y=(0,r.c)(20),{className:b,accessibleHeader:x}=e,{message:_}=(0,d.V)(),N=_.content??"";y[0]!==N?(t=(0,u._)(N),y[0]=N,y[1]=t):t=y[1];let{availableAgents:C}=(0,l.JE)(t);if(y[2]!==x||y[3]!==b||y[4]!==_.references||y[5]!==C||y[6]!==N){let e=void 0===C?[]:C,t=(0,o.l)().use(c.U,{references:_.references??[],agents:e,commands:[]}).parse(N);y[10]!==x?(g=x&&(0,i.jsx)("h3",{className:"sr-only",children:x}),y[10]=x,y[11]=g):g=y[11],y[12]!==b?(n=(0,s.$)(m.A.container,b),y[12]=b,y[13]=n):n=y[13],a=t.children.map(h),y[2]=x,y[3]=b,y[4]=_.references,y[5]=C,y[6]=N,y[7]=n,y[8]=a,y[9]=g}else n=y[7],a=y[8],g=y[9];return y[14]!==n||y[15]!==a?(p=(0,i.jsx)("div",{className:n,children:a}),y[14]=n,y[15]=a,y[16]=p):p=y[16],y[17]!==g||y[18]!==p?(f=(0,i.jsxs)(i.Fragment,{children:[g,p]}),y[17]=g,y[18]=p,y[19]=f):f=y[19],f}function h(e,t){switch(e.type){case"text":case"command":return e.value;case"agent-mention":return(0,i.jsx)(p,{agent:e.data.mentionedAgent,children:e.value},t);case"reference-mention":return void 0!==e.data.mentionedReferenceId?(0,i.jsx)("span",{className:m.A.mention,children:e.value},t):e.value}}function p(e){let t,n=(0,r.c)(4),{agent:s,children:o}=e,l=`/integrations/${s.slug}/hovercard`;return n[0]!==s.integrationUrl||n[1]!==o||n[2]!==l?(t=(0,i.jsx)(a.A,{href:s.integrationUrl,"data-hovercard-url":l,className:m.A.mention,children:o}),n[0]=s.integrationUrl,n[1]=o,n[2]=l,n[3]=t):t=n[3],t}try{g.displayName||(g.displayName="UserMessage")}catch{}try{p.displayName||(p.displayName="AgentLink")}catch{}},82178:(e,t,n)=>{n.d(t,{W:()=>g});var i=n(74848),r=n(21728),a=n(74807),s=n(34164),o=n(96540);let l={copilotBadge:"CopilotBadgeV2-module__copilotBadge--w1X6Q",loading:"CopilotBadgeV2-module__loading--qeW04",animation:"CopilotBadgeV2-module__animation--ttRRT",assistive:"CopilotBadgeV2-module__assistive--YGoYv",clickableAnimationWrapper:"CopilotBadgeV2-module__clickableAnimationWrapper--i45z5"},c=[a.L.Tickle,a.L.Celebrate,a.L.JumpWiggle],u=["yes","absolutely","certainly","sure","definitely","right","correct","indeed","precisely","exactly","true","affirmative","agree","agreed"],d=["no","never","negative","wrong","false","untrue","cannot","can't","sorry","incorrect","deny","disagree","refuse","unfortunately"];function m(e){let t=new Date(e);return(new Date().getTime()-t.getTime())/1e3/60<.5}function g(e){let t,n,g,p,f,y,b,x,_,N,C=(0,r.c)(37),{isFirstMessage:T,isLoading:v,isLoadingSkills:I,isError:k,className:$,mode:S,message:j,createdAt:w}=e,M=void 0!==T&&T;C[0]!==w||C[1]!==M?(t=()=>({animationType:M&&(!w||m(w))?a.L.Celebrate:a.L.Static,onFinish:a.L.Static,loopAnimation:!1,hasLoadedMessage:!1}),C[0]=w,C[1]=M,C[2]=t):t=C[2];let[A,L]=(0,o.useState)(t);C[3]!==w||C[4]!==k||C[5]!==v||C[6]!==I||C[7]!==j?(n=()=>{m(w)&&L(e=>(function({previousState:e,isLoadingSkills:t,isAffirmativeSentiment:n,isNegativeSentiment:i,isError:r,isLoading:s}){switch(e.animationType){case a.L.Static:if((n||i)&&!r&&!e.hasLoadedMessage)return{animationType:n?a.L.Affirmative:a.L.Negative,onFinish:a.L.Static,loopAnimation:!1,hasLoadedMessage:!0};if(t)return{...e,animationType:a.L.Thinking,loopAnimation:!0};if(!s&&!e.hasLoadedMessage&&!r)return{animationType:a.L.Confirm,onFinish:a.L.Static,loopAnimation:!1,hasLoadedMessage:!0};if(r&&!e.hasLoadedMessage)return{animationType:a.L.Negative,onFinish:a.L.Static,loopAnimation:!1,hasLoadedMessage:!0};return e;case a.L.Thinking:if(!t)return{...e,animationType:r?a.L.Negative:a.L.Static,loopAnimation:!1};return e;default:return e}})({previousState:e,isLoadingSkills:I||!1,isError:k||!1,isLoading:v||!1,isAffirmativeSentiment:function(e){if(e.length<200){let t=e.toLowerCase().split(/\W+/).filter(Boolean);return u.some(e=>t.includes(e.toLowerCase()))}return!1}(j),isNegativeSentiment:function(e){if(e.length<200){let t=e.toLowerCase().split(/\W+/).filter(Boolean);return d.some(e=>t.includes(e.toLowerCase()))}return!1}(j)}))},C[3]=w,C[4]=k,C[5]=v,C[6]=I,C[7]=j,C[8]=n):n=C[8],C[9]!==A.animationType||C[10]!==A.hasLoadedMessage||C[11]!==w||C[12]!==k||C[13]!==M||C[14]!==v||C[15]!==I||C[16]!==j?(g=[I,k,v,A.animationType,A.hasLoadedMessage,M,j,w],C[9]=A.animationType,C[10]=A.hasLoadedMessage,C[11]=w,C[12]=k,C[13]=M,C[14]=v,C[15]=I,C[16]=j,C[17]=g):g=C[17],(0,o.useEffect)(n,g),C[18]!==A||C[19]!==v?(p=()=>{v||L({...A,animationType:c[Math.floor(Math.random()*c.length)],onFinish:a.L.Static,loopAnimation:!1})},C[18]=A,C[19]=v,C[20]=p):p=C[20];let R=p,B=v&&l.loading;C[21]!==$||C[22]!==B?(f=(0,s.$)(l.copilotBadge,B,$),C[21]=$,C[22]=B,C[23]=f):f=C[23];let F=A.animationType;C[24]===Symbol.for("react.memo_cache_sentinel")?(y=()=>L(h),C[24]=y):y=C[24];let D=A.loopAnimation,U="assistive"===S&&l.assistive;return C[25]!==U?(b=(0,s.$)(l.animation,U),C[25]=U,C[26]=b):b=C[26],C[27]!==A.animationType||C[28]!==A.loopAnimation||C[29]!==b?(x=(0,i.jsx)(a.N,{animationType:F,onAnimationEnd:y,loopAnimation:D,className:b}),C[27]=A.animationType,C[28]=A.loopAnimation,C[29]=b,C[30]=x):x=C[30],C[31]!==R||C[32]!==x?(_=(0,i.jsx)("div",{onClick:R,className:l.clickableAnimationWrapper,children:x}),C[31]=R,C[32]=x,C[33]=_):_=C[33],C[34]!==_||C[35]!==f?(N=(0,i.jsx)("div",{className:f,"aria-label":"Copilot badge",role:"img",children:_}),C[34]=_,C[35]=f,C[36]=N):N=C[36],N}function h(e){return{...e,animationType:e.onFinish}}try{g.displayName||(g.displayName="CopilotBadge")}catch{}},88392:(e,t,n)=>{n.d(t,{a:()=>o});var i=n(96540),r=n(63262),a=n(73952),s=n(51213);function o(e){let{streamingMessage:t,isWaitingOnCopilot:n,messages:o,selectedThreadID:l,pendingFirstMessage:c}=e,u=(0,i.useMemo)(()=>{let e={id:s.Wp,role:"assistant",content:"",createdAt:"",threadID:l||"",references:[],clientSide:!0,messageIndex:-1},i=(0,a.B)(o,c);return n?[...i,t??e]:i},[l,o,c,n,t]);return{messages:u,groupedMessages:(0,r.A)(u)}}},93412:(e,t,n)=>{n.d(t,{h:()=>o});var i=n(74848),r=n(21728),a=n(57352);let s={container:"LegalDisclaimer-module__container--lNe5E"},o=()=>{let e,t=(0,r.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxs)("span",{className:s.container,children:[(0,i.jsx)(a.A,{href:"https://docs.github.com/en/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-chat-in-githubcom",inline:!0,muted:!0,children:"Copilot"})," ","uses AI. Check for mistakes."]}),t[0]=e):e=t[0],e};try{o.displayName||(o.displayName="LegalDisclaimer")}catch{}},94517:(e,t,n)=>{n.d(t,{h:()=>T,K:()=>N});var i=n(74848),r=n(21728),a=n(4817),s=n(38621),o=n(57352),l=n(87448),c=n(62227);function u({error:e,className:t}){let n=e.identifier||"",r=n.split("url=")[1]||"",a=n.match(/\/([^/]+)\/sso/),u=a&&a[1]||"";return u&&r?(0,i.jsx)("div",{className:t,"data-testid":"sso-banner",children:(0,i.jsx)("div",{className:c.A.Box,children:(0,i.jsx)("section",{"aria-label":"Single sign-on information",children:(0,i.jsx)(l.Hx,{sx:{borderRadius:2,borderWidth:1},className:c.A.Flash,children:(0,i.jsxs)("div",{children:[(0,i.jsx)(s.ShieldLockIcon,{}),(0,i.jsx)(o.A,{inline:!0,href:function({authorizeUrl:e}){let t=new URL(e,window.location.origin);return t.searchParams.set("return_to",window.location.toString()),t.toString()}({authorizeUrl:r}),children:"Single sign-on"})," ","to see results in the ",(0,i.jsx)("b",{children:u})," organization."]})})})})}):null}try{u.displayName||(u.displayName="SSOBannerFromError")}catch{}var d=n(29731),m=n(84078),g=n(26108),h=n(21373),p=n(34164),f=n(96540),y=n(25641),b=n(17285),x=n(77939),_=n(46665);function N(e){let t=(0,r.c)(8),{manager:n}=e,{message:a}=(0,_.V)(),{error:s}=a;if(!s)return null;switch(s.type){case"agentUnauthorized":{let e;return t[0]!==s||t[1]!==n?(e=(0,i.jsx)(C,{error:s,manager:n}),t[0]=s,t[1]=n,t[2]=e):e=t[2],e}case"agentRequest":{let e;return t[3]!==s.details?(e=(0,i.jsx)(T,{errors:[s.details]}),t[3]=s.details,t[4]=e):e=t[4],e}default:{let e,n;t[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,d.G)("error-message-banner"),t[5]=e):e=t[5];let r=s.message||"Something went wrong";return t[6]!==r?(n=(0,i.jsx)(m.l,{...e,title:"Error",hideTitle:!0,description:r,variant:"warning"}),t[6]=r,t[7]=n):n=t[7],n}}}function C(e){let t,n,a,o,l,c,u,m,b,_,N,C=(0,r.c)(25),{error:T,manager:v}=e,{details:I}=T,[k,$]=(0,f.useState)(!1);C[0]!==I.name||C[1]!==v?(t=()=>{$(!0),v.dispatch({type:"MESSAGE_ADDED",message:(0,y.Y6)({role:"user",content:`Dismissed the connection with ${I.name}.`,mediaContent:[],parentMessageID:v.FindLastMessageID()})}),v.dispatch({type:"MESSAGE_ADDED",message:(0,y.Y6)({role:"assistant",content:`I was unable to connect you to ${I.name} because you cancelled the authentication.`,mediaContent:[],parentMessageID:v.FindLastMessageID()})})},C[0]=I.name,C[1]=v,C[2]=t):t=C[2];let S=t;C[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,d.G)("agent-unauthorized-error"),C[3]=n):n=C[3],C[4]!==k||C[5]!==S?(a=!k&&(0,i.jsx)(g.K,{"aria-label":"Close",className:"position-absolute top-0 right-0 mt-2 mr-2",icon:s.XIcon,onClick:S,variant:"invisible",unsafeDisableTooltip:!0}),C[4]=k,C[5]=S,C[6]=a):a=C[6],C[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,i.jsx)(s.MarkGithubIcon,{size:48,className:"border circle borderColor-muted"}),l=(0,i.jsx)(s.LinkIcon,{className:"fgColor-muted"}),c=(0,p.$)("avatar",x.A.agentUnauthorizedAvatar,"border circle borderColor-muted"),C[7]=o,C[8]=l,C[9]=c):(o=C[7],l=C[8],c=C[9]);let j=`icon for ${I.name}`;return C[10]!==I.avatar_url||C[11]!==j?(u=(0,i.jsxs)("div",{className:"d-flex flex-items-center gap-2",children:[o,l,(0,i.jsx)("img",{className:c,src:I.avatar_url,alt:j})]}),C[10]=I.avatar_url,C[11]=j,C[12]=u):u=C[12],C[13]!==I.name?(b=(0,i.jsxs)("p",{className:"h4 m-0 text-center",children:["Connect with ",I.name]}),m=(0,i.jsxs)("p",{className:"fgColor-muted text-center",children:["To use the ",I.name," extension, you\u2019ll need to connect your GitHub account to your ",I.name," account."]}),C[13]=I.name,C[14]=m,C[15]=b):(m=C[14],b=C[15]),C[16]!==I.authorize_url||C[17]!==k?(_=!k&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Q,{as:"a",variant:"primary",size:"large",className:"width-full",href:I.authorize_url,rel:"noopener",target:"_blank",children:"Connect"}),(0,i.jsxs)("p",{className:"fgColor-muted text-center f6 m-0",children:["Click connect to be redirected to ",I.authorize_url]})]}),C[16]=I.authorize_url,C[17]=k,C[18]=_):_=C[18],C[19]!==m||C[20]!==_||C[21]!==a||C[22]!==u||C[23]!==b?(N=(0,i.jsxs)("div",{className:"position-relative d-flex flex-column flex-items-center gap-3 border rounded-2 p-5",...n,children:[a,u,b,m,_]}),C[19]=m,C[20]=_,C[21]=a,C[22]=u,C[23]=b,C[24]=N):N=C[24],N}function T(e){let t,n,a=(0,r.c)(4),{errors:s}=e;return a[0]!==s?(t=s.map(v),a[0]=s,a[1]=t):t=a[1],a[2]!==t?(n=(0,i.jsx)("div",{className:"d-flex flex-column gap-2",children:t}),a[2]=t,a[3]=n):n=a[3],n}function v(e,t){var n,r,o,l,c;return n=e,r=t,"sso"===n.code?(0,i.jsx)(u,{error:n,className:"mt-3"},r):(o=n,l=r,(0,i.jsxs)("div",{className:"p-3 border rounded-2",children:[(0,i.jsxs)("div",{className:"text-bold",children:[(0,i.jsx)(s.AlertFillIcon,{className:"mr-1 fgColor-attention"})," ","http"===(c=o).type?`${c.code} ${c.identifier}`:`${(0,b.Z)(c.type)} error`]}),(0,i.jsx)(a.To,{markdown:o.message})]},l))}try{N.displayName||(N.displayName="ErrorMessage")}catch{}try{C.displayName||(C.displayName="AgentUnauthorizedError")}catch{}try{T.displayName||(T.displayName="AgentErrors")}catch{}}}]); //# sourceMappingURL=packages_copilot-chat_hooks_use-chat-message-behavior_ts-packages_copilot-chat_hooks_use-grou-d552cd-04e990d6d25c.js.map